#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read() {
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 5e5+10;
int n,k;
char s[N];

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,k = in; scanf("%s",s);
	int p = 1;
	for(int i = 1;i < n;i++) {
		if(s[i] > s[i % p]) break;
		else if(s[i] < s[i % p]) p = i + 1;
	}
	for(int i = 0;i < k;i++) putchar(s[i % p]); puts("");
	return 0;
}
